﻿using System;
using System.ComponentModel.Design;
using System.Windows;
using Microsoft.VisualStudio.Shell;
using NerdWare.Crm2011VsTools.Globals;
using NerdWare.Crm2011VsTools.ToolWindows;
using NerdWare.Crm2011VsTools.ViewModel;

namespace NerdWare.Crm2011VsTools.Controls
{
    /// <summary>
    /// Interaction logic for CrmExplorerControl.xaml
    /// </summary>
    public partial class CrmExplorerControl
    {
        private readonly CrmExplorerToolWindow _crmExplorerToolWindow;

        public CrmExplorerControl(CrmExplorerToolWindow crmExplorerToolWindow)
        {

            _crmExplorerToolWindow = crmExplorerToolWindow;

            OleMenuCommandService mcs = _crmExplorerToolWindow.Mcs;
            if (null != mcs)
            {
                CommandID addNewCmd = new CommandID(GuidList.Crm2011VsToolsCmdSet, PkgCmdIDList.CmdIdCrmExplorerNew);
                mcs.AddCommand(new MenuCommand(AddNew, addNewCmd));
            }

            DataContext = new CrmExplorerViewModel();

            InitializeComponent();
        }

        private void AddNew(object sender, EventArgs e)
        {
            //((ScriptInjectorViewModel)this.DataContext).FlipOnOff(sender, e);
            MessageBox.Show("Add New pressed.");
        }
    }
}
